<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>
<style>
	*{

	  margin: 0;
	  padding: 0;
	}
	div{

		/*text-align: center;
		background: red;
		height: 200px;
		line-height: 200px;*/
		/*background: red;
		width:fit-content;将父元素设为和子元素宽度一样
		margin: auto;*/
		
	}
</style>
<body>
	<div>
		<span>居中</span>
	</div>
</body>
</html>